


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > MybatisPlusConfig</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">com.ie.common.config</a>
</div>

<h1>Coverage Summary for Class: MybatisPlusConfig (com.ie.common.config)</h1>

<table class="coverageStats">

<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">MybatisPlusConfig</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (3/3)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (6/6)
  </span>
</td>
</tr>
  <tr>
    <td class="name">MybatisPlusConfig$$SpringCGLIB$$0</td>
  </tr>
  <tr>
    <td class="name">MybatisPlusConfig$$SpringCGLIB$$FastClass$$0</td>
  </tr>
  <tr>
    <td class="name">MybatisPlusConfig$$SpringCGLIB$$FastClass$$1</td>
  </tr>
<tr>
  <td class="name"><strong>Total</strong></td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (3/3)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (6/6)
  </span>
</td>
</tr>
</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package com.ie.common.config;
&nbsp;
&nbsp;import com.baomidou.mybatisplus.annotation.DbType;
&nbsp;import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
&nbsp;import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
&nbsp;import lombok.extern.slf4j.Slf4j;
&nbsp;import org.springframework.context.annotation.Bean;
&nbsp;import org.springframework.context.annotation.Configuration;
&nbsp;
&nbsp;/**
&nbsp; * @classname: MybatisPlusConfig
&nbsp; * @Author: royxu
&nbsp; * @Description: MP分页拦截器设置
&nbsp; * @Date: 2025/4/16  10:33
&nbsp; * @Param:
&nbsp; * @version: 1.0
&nbsp; **/
<b class="fc">&nbsp;@Slf4j</b>
&nbsp;@Configuration
<b class="fc">&nbsp;public class MybatisPlusConfig {</b>
&nbsp;    // https://blog.csdn.net/m0_43450656/article/details/124543348  Mybatis-Plus的分页插件在3.4版本后的使用方法
&nbsp;    // https://blog.csdn.net/baidu_28705493/article/details/141378451 Spring Boot集成MyBatis配置流程
&nbsp;    // 配置分页插件
&nbsp;    @Bean
&nbsp;    public MybatisPlusInterceptor mybatisPlusInterceptor() {
&nbsp;        // 创建MybatisPlusInterceptor实例，MyBatis-Plus通过拦截器（Interceptor）机制来实现对SQL操作的增强。
&nbsp;        // MybatisPlusInterceptor是MyBatis-Plus提供的拦截器，用于拦截SQL操作，并在操作前后执行一些额外的逻辑
<b class="fc">&nbsp;        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();</b>
&nbsp;        /*
&nbsp;         * 添加PaginationInnerInterceptor（分页内部拦截器），指定数据库类型为MySQL。向一个拦截器链中添加一个用于
&nbsp;         * 分页的拦截器。具体来说，它使用了MyBatis-Plus框架中的PaginationInnerInterceptor，这是一个用于处理数
&nbsp;         * 据库分页的拦截器，支持多种数据库类型，包括MySQL。
&nbsp;         */
<b class="fc">&nbsp;        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));</b>
&nbsp;        // 返回配置好的拦截器实例。
<b class="fc">&nbsp;        log.info(&quot;This is mybatisPlusInterceptor!&quot;);</b>
<b class="fc">&nbsp;        return interceptor;</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-06-15 18:23</div>
</div>
</body>
</html>
